/*
package xyz.labmem.main.modular.app.indexShow.controller;

import cn.hutool.core.util.ClassUtil;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.xwpf.usermodel.*;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.labmem.base.core.annotion.NoNeedLogin;
import xyz.labmem.base.sys.consts.PathPrefixConst;
import xyz.labmem.main.modular.app.indexShow.controller.response.ColumEntiy;
import xyz.labmem.main.modular.app.indexShow.controller.response.TableEntiy;
import xyz.labmem.main.modular.app.zhgk.mapper.App_zhgfdywyhbsjgcjb_Mapper;

import java.io.File;
import java.io.FileOutputStream;
import java.math.BigInteger;
import java.util.ArrayList;

@RestController
@Api(tags = "测试")
@RequestMapping(PathPrefixConst.APP_PATH_PREFIX+ "indexShow")
public class TestController {
    @Autowired
    private App_zhgfdywyhbsjgcjb_Mapper appZhgfdywyhbsjgcjbMapper;
    */
/**
     * 根据用户编号获取详细信息
     *//*

    @ApiOperation(value = "综合概况数据展示")
    @GetMapping("word")
    @NoNeedLogin
    public void getInfo() {
        try {
            write2Docx();
        } catch (Exception e){
            e.printStackTrace();
        }

    }
    public void write2Docx()throws Exception{
        XWPFDocument document= new XWPFDocument();

        //Write the Document in file system  create_table.docx
        FileOutputStream out = new FileOutputStream(new File("F:\\Offer\\create_table.docx"));


        //换行
        XWPFParagraph paragraph1 = document.createParagraph();
        XWPFRun paragraphRun1 = paragraph1.createRun();
        paragraphRun1.setText("\r");

        var classs = ClassUtil.scanPackage("xyz.labmem.main.modular.app.rmfk.entity");

        int i=1;
        for(Class<?> it : classs){

            TableName table = it.getAnnotation(TableName.class);
            TableEntiy tableMap = appZhgfdywyhbsjgcjbMapper.selectTable(table.value());
            ArrayList<ColumEntiy> columnMap = appZhgfdywyhbsjgcjbMapper.selectColumn(table.value());

            XWPFParagraph aragraph0 = document.createParagraph();
            XWPFRun run0 = aragraph0.createRun();
            run0.setText("标题122："+tableMap.getTableComment());
            run0.setFontSize(16);

            XWPFParagraph aragraph1 = document.createParagraph();
            XWPFRun run1 = aragraph1.createRun();
            run1.setText("表名："+tableMap.getTableName());
            run1.setFontSize(16);

            XWPFParagraph aragraph2 = document.createParagraph();
            XWPFRun run2 = aragraph2.createRun();
            run2.setText("描述："+tableMap.getTableComment());
            run2.setFontSize(16);

            XWPFParagraph aragraph3 = document.createParagraph();
            XWPFRun run3 = aragraph3.createRun();
            run3.setText("表"+ i + " "+tableMap.getTableComment());
            run3.setFontSize(16);

            XWPFTable infoTable1 = document.createTable();
            //列宽自动分割
            CTTblWidth infoTableWidth = infoTable1.getCTTbl().addNewTblPr().addNewTblW();
            infoTableWidth.setType(STTblWidth.DXA);
            infoTableWidth.setW(BigInteger.valueOf(9072));

            //表格第一行
            XWPFTableRow infoTableRowOne = infoTable1.getRow(0);
            infoTableRowOne.getCell(0).setText("列名");
            infoTableRowOne.addNewTableCell().setText("数据类型");
            infoTableRowOne.addNewTableCell().setText("长度");
            infoTableRowOne.addNewTableCell().setText("允许空");
            infoTableRowOne.addNewTableCell().setText("字段描述");
            for(ColumEntiy map : columnMap){
                XWPFTableRow infoTableRowTwo = infoTable1.createRow();
                infoTableRowTwo.getCell(0).setText(map.getColumnName());
                infoTableRowTwo.getCell(1).setText(map.getDataType());
                infoTableRowTwo.getCell(2).setText(String.valueOf(map.getCharacterMaximumLength())==null?"":String.valueOf(map.getCharacterMaximumLength()));
                infoTableRowTwo.getCell(3).setText(map.isRequired());
                infoTableRowTwo.getCell(4).setText(map.getColumnComment());
            }
            i++;
        }

        document.write(out);
        out.close();
    }
}
*/
